/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.egitim.model;

 
 
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinTable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import org.apache.wicket.IClusterable;

/**
 * Simple "POJO" bean for guestbook comments.
 * 
 *  @author Murat Hunoglu
 */
@Entity(name="anaGonderi")
public class AnaGonderi extends BaseEntity implements IClusterable 
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Column(columnDefinition="LONGTEXT")
	private String text;
	
	private String title;
	  @ManyToMany(cascade=CascadeType.ALL)
	  @JoinTable(name = "AnaGonderiEtiket",
	    joinColumns = {
	      @JoinColumn(name="anaGonderiId")           
	    },
	    inverseJoinColumns = {
	      @JoinColumn(name="etiketId")
	    }
	  )
	  @Column
	  private List<Etiket> etiketSet;
    /**
     * Constructor
     */
    public AnaGonderi()
    {
    }
    
 
	public List<Etiket> getEtiketSet() {
		return etiketSet;
	}


 

	public void setEtiketSet(List<Etiket> etiketSet) {
		this.etiketSet = etiketSet;
	}


   public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	/**
     * Copy constructor
     * 
     * @param comment
     *            The comment to copy
     */
    public AnaGonderi(final AnaGonderi comment)
    {
        this.text = comment.text;
        
    }

    /**
     * @return Returns the text.
     */
    public String getText()
    {
        return text;
    }

    /**
     * @param text
     *            The text to set.
     */
    public void setText(String text)
    {
        this.text = text;
    }

   

    /**
     * @see java.lang.Object#toString()
     */
    public String toString()
    {
        return "[Comment date = " + this.getCreatedAt() + ", text = " + text + "]";
    }

	@Override
	public String getDisplayText() {
		// TODO Auto-generated method stub
		return null;
	}
}
